#include <stdio.h>

#define TRACE(x...) 
#define PRINT(x...) TRACE(printf(x))

#define rep(i,n) for (int i=0; i<n; i++)

int n;
int f91[110];
int tmp;

int pre(int a) {
	if (a>=101)
		return a-10;

	if (f91[a]==-1) 
		f91[a] = pre(pre(a+11));
	
	return f91[a];
}

int main() {
	rep(i,101) f91[i]=-1;

	for (int i=100; i>0; i--) pre(i);

	TRACE(
		for (int i=1; i<=100; i++)
			printf("%d ", f91[i]);
		printf("\n");
	)

	while (1) {
		scanf("%d", &n);
		if (!n) break;

		if (n>=101)
			printf("f91(%d) = %d\n", n, n-10);
		else 
			printf("f91(%d) = %d\n", n, f91[n]);
	}
	
	return 0;
}
